package o;

import android.graphics.Bitmap;
import android.graphics.Matrix;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import com.bumptech.glide.Glide;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;

public final class eqw {

    static class c extends wl {
        protected Bitmap ॱ(uc ucVar, Bitmap bitmap, int i, int i2) {
            Matrix matrix = new Matrix();
            matrix.postRotate(-90.0f);
            return Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
        }

        public void ॱ(@NonNull MessageDigest messageDigest) {
            try {
                messageDigest.update("rotate".getBytes("UTF-8"));
            } catch (UnsupportedEncodingException e) {
                Logger.ˏ("ImageCircleUtils", "updateDiskCacheKey exception : " + e.toString());
            }
        }
    }

    public static void ˋ(ImageView imageView, String str, boolean z, String str2) {
        ro ˏ = ˏ(imageView, str, z);
        if (ˏ != null) {
            eqx.ˏ(ˏ, str2, imageView);
            ˏ.ॱ(new era()).ˏ(imageView);
        }
    }

    public static void ˎ(ImageView imageView, String str, boolean z) {
        ro ˏ = ˏ(imageView, str, z);
        if (ˏ != null) {
            ˏ.ॱ(new era()).ˏ(imageView);
        }
    }

    private static ro<Bitmap> ˏ(ImageView imageView, String str, boolean z) {
        if (imageView == null || str == null) {
            Logger.ˎ("ImageCircleUtils", "asynLoadImage param is null");
            return null;
        }
        zp zpVar = (zp) new zp().ॱ(true);
        ro<Bitmap> ॱ = Glide.ˏ(imageView.getContext()).ॱ().ˎ(str).ॱ(zpVar);
        return z ? ॱ.ॱ(new era()).ॱ((zp) zpVar.ˏ(new c())) : ॱ;
    }
}
